<?php
App::uses('AppController', 'Controller');
/**
 * Images Controller
 *
 */
class ImagesController extends AppController {

/**
 * Scaffold
 *
 * @var mixed
 */
	public $scaffold;
        public $uses = array('Image');
        
        public function delete($imageId,$projectId){
            $data = $this->Image->find('first',array(
                'conditions'=>array('Image.id'=>$imageId)
            ));
            if ($this->Image->delete($imageId)) {
                unlink('img/' . $data['Image']['path']);
                $this->Session->setFlash('Remove Success!!');
            }
            $this->redirect('/Projects/upImage/'.$projectId);
        }

}
